<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入主题样式 -->
<link href="../themes/bootstrap/easyui.css" rel="stylesheet"></link>
<!-- 引入图标样式 -->
<link href="../themes/icon.css" rel="stylesheet"></link>
<!-- 引入jquery-->
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<!-- 引入easyui.js -->
<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
<!-- 引入本地语言 -->
<script type="text/javascript" src="../js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
	$(function() {
		//配置数据表格
		$('#Msg').datagrid({
			url : '${pageContext.request.contextPath}/commoditysales',
			columns : [ [ {
				field : 'pid',
				title : '商品编号',
				width : 200
			}, {
				field : 'pname',
				title : '商品名称',
				width : 200
			}, {
				field : 'cname',
				title : '商品类名',
				width : 200
			}, {
				field : 'pprice',
				title : '商品价格',
				width : 200,
				align : 'right'
			}, {
				field : 'volume',
				title : '销售量',
				width : 200,
				align : 'right'
			}, {
				field : 'smoney',
				title : '销售额',
				width : 200,
				align : 'right'
			}, ] ],
			pagination : true,
			toolbar : '#tb',
			striped : true,
			rownumbers : true,
			queryParams: {
				date1:"",
				date2:"",
				cate:"全部",
				pname:""
			}

		});
	})
	
	function doSearch() {
		var date1 = $('#date1').datebox('getValue');
		var date2 = $('#date2').datebox('getValue');
		var cate = $("#cate").combobox('getText');  
		var pname = $("#pname").val();
		$('#Msg').datagrid('reload',{
				date1:date1,
				date2:date2,
				cate:cate,
				pname:pname
			})
	}
</script>
<body style="background:url(../images/44.jpg);width: 100%; height: 100%">
	<table id="Msg"></table>
	<!-- 工具栏 -->
	<div id="tb" style="padding: 5px; height: auto">
		<div>
			日期  从:
			<input id="date1" class="easyui-datebox" editable="false" style="width: 100px">
			到:
			<input id="date2" class="easyui-datebox" editable="false" style="width: 100px">
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			商品类别:
			<input id="cate" class="easyui-combobox" value="全部" editable="false" style="width: 100px" url="${pageContext.request.contextPath}/getcategory" valueField="cid" textField="cname">
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			商品名称:
			<input id="pname" class="easyui-textbox"  style="width:100px">
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<a id="search" href="#" class="easyui-linkbutton" onclick="doSearch()">查询</a>
		</div>
	</div>
</body>
</html>